home *** CD-ROM | disk | FTP | other *** search
/ Clipper Collection / Clipper Collection.iso / clipper7 / nannws24.arc / MODCONF.PRG < prev    next >
Text File  |  1988-05-18  |  2KB  |  47 lines

  1. * Program: MODCONFG.PRG
  2. * Author:  Gerry S. Braganza
  3. * Version: Clipper Summer '87
  4. * Notes:   Modify CONFIG.SYS
  5. * Copyright (c) 1988 Nantucket Corp.
  6. *
  7.  
  8. b=0
  9. f=0
  10.  
  11. @ 12,12 SAY "Enter the number of files " GET f PICT "999"
  12. @ 13,12 SAY "Enter the number of buffers " GET b PICT "999"
  13. READ
  14.  
  15. var=MEMOREAD("c:\config.sys")   && store file to memory variable
  16.  
  17. fflag=.t.                       && set flags to true for FILES
  18. bflag=.t.                       && and BUFFERS not present
  19.  
  20. FOR i = 1 TO MLCOUNT(var,80)    && count number of lines in file
  21.     tmp=MEMOLINE(var,80,i)      && extract each line from file
  22.  
  23.     * if FILES is present change to specific value entered
  24.     IF "FILES" $UPPER(tmp)                                
  25.        var=STRTRAN(var,TRIM(tmp),"FILES="+LTRIM(str(f)))
  26.        fflag=.f.                && set file flag to false
  27.     ENDIF  
  28.  
  29.     * if BUFFERS is present change specific value entered
  30.     IF "BUFFERS" $UPPER(tmp)
  31.        var=STRTRAN(var,TRIM(tmp),"BUFFERS="+LTRIM(str(b)))
  32.        bflag=.f.                && set buffer flag to false
  33.     ENDIF
  34. NEXT
  35.  
  36. IF fflag                        && if files not present
  37.                                 ** add to CONFIG.SYS
  38.     var=var+CHR(13)+CHR(10)+"FILES="+LTRIM(STR(f))
  39. ENDIF
  40. IF bflag                        && if buffers not present
  41.                                 ** add to CONFIG.SYS
  42.     var=var+CHR(13)+CHR(10)+"BUFFERS="+LTRIM(STR(b))
  43. ENDIF
  44. MEMOWRIT("c:\config.sys",var)   && write new CONFIG.SYS to disk
  45.  
  46. * EOP: MODCONFG.PRG
  47.